package com.stone.business.jc.action;

/**
 * <pre>
 * 绩效统计查询
 * </pre>
 */

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.stone.business.jc.service.JcCommonService;
import com.stone.business.jc.pojo.TJxcp;

import frm.ssh.action.BaseListAction;

public class JxcpListAction extends BaseListAction {

	private static final long serialVersionUID = 3979577965804736350L;
	
	private JcCommonService myService;
	
	public JcCommonService getMyService() {
		return myService;
	}

	public void setMyService(JcCommonService myService) {
		this.service = myService;
		this.myService = myService;
	}
	
    /** * 构造方法. */
    public JxcpListAction() {
        this.entityClass = TJxcp.class;
    }
    
    public String init() {
    	return SUCCESS;
    }
	
	/**
	 * 设置查询条件
	 */
	public HashMap<String, Object> setSearchCondition() {
		
		HashMap<String, Object> m = new HashMap<String, Object>();
		
		List<Object> valsList = new ArrayList<Object>();
		
		
		m.put("cols", "new map(s.id as id, to_char(s.tjsjks,'yyyy-MM-dd') || '~' || to_char(s.tjsjjs,'yyyy-MM-dd') as tjsj, filenameen as filenameen, filenamecn as filenamecn)");

		
		// 巡视类型
		String conditions = " 1=1"; 
		
//		// 巡视开始时间
//		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon2())) {
//			conditions += " AND TO_CHAR(s.kssj,'yyyy-MM-dd') >= ?";
//			valsList.add(super.getSearchBean().getCon2());
//		}
//		
//		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon3())) {
//			conditions += " AND TO_CHAR(s.jssj,'yyyy-MM-dd') <= ?";
//			valsList.add(super.getSearchBean().getCon3());
//		}
//		
//		// 变电站
//		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon4())) {
//			conditions += " AND s.bdzname like ?";
//			valsList.add("%" + super.getSearchBean().getCon4()+ "%");
//		}
//		
//		// 巡视类型
//		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon7())) {
//			conditions += " AND s.xslx = ?";
//			valsList.add(super.getSearchBean().getCon7());
//		}
		
		// 查询条件
		m.put("conditions",conditions);
		m.put("clause", " order by s.tjsjks Desc");
		m.put("alias", "s");
		m.put("vals", valsList.toArray());

		
		return m;
		
	}

	
}
